package com.zkthink.ceres.tenant.dto;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zkthink.ceres.common.utils.RegexUtil;
import com.zkthink.ceres.tenant.enumeration.TenantStatusEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

/**
 * <p>
 * 实体类 企业
 * </p>
 *
 * @author ceres
 * @since 2019-10-24
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Builder
@ApiModel(value = "TenantSaveDTO", description = "企业")
public class TenantSaveDTO implements Serializable {

  private static final long serialVersionUID = 1L;

  @ApiModelProperty(hidden = true)
  private String code;

  /**
   * 企业名称
   */
  @ApiModelProperty(value = "商家名称")
  @Length(max = 255, message = "商家名称长度不能超过255")
  private String name;
  /**
   * 责任人
   */
  @ApiModelProperty(value = "责任人")
  @Length(max = 50, message = "责任人长度不能超过50")
  private String duty;


  /**
   * 企业简介
   */
  @ApiModelProperty(value = "企业简介")
  @Length(max = 255, message = "企业简介长度不能超过255")
  private String describe;

  /**
   * 联系电话
   */
  @ApiModelProperty(value = "联系电话")
  @Length(max = 16, message = "联系电话长度不能超过16")
  private String contactTel;

  /**
   * 地址
   */
  @ApiModelProperty(value = "地址")
  @Length(max = 500, message = "地址长度不能超过500")
  private String address;

  /**
   * 生效时限
   */
  @ApiModelProperty(value = "生效时限，单位年")
  private Integer expireLimitYear;
  /**
   * 生效时间
   */
  @ApiModelProperty(value = "生效时间")
  @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
  private LocalDateTime startTime;

  /**
   * 密码
   */
  @ApiModelProperty(value = "密码")
  @Length(max = 64, message = "密码长度不能超过64")
  @NotEmpty(message = "密码不能为空")
  private String password;

  /**
   * 确认密码
   */
  @ApiModelProperty(value = "确认密码")
  @Length(max = 64, message = "确认密码长度不能超过76")
  @NotEmpty(message = "确认密码不能为空")
  private String confirmPassword;

  /**
   * 手机号
   */
  @ApiModelProperty(value = "账号（手机号）")
  @Pattern(regexp = RegexUtil.REGEX_MOBILE_EXACT, message = "请输入正确的手机号")
  private String mobile;

  @ApiModelProperty(value = "合同状态,NORMAL:生效 FORBIDDEN：失效")
  private TenantStatusEnum status;

}
